<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>
<body>
    <input type="file" name="file" id="file" accept="*" >
     
    <button onclick="upload()">上传</button>
    <script>
        function upload(){
            console.log('3');
            
            var file = document.getElementById('file').files[0];
            console.log(file,'123');
            
            var formData = new FormData();
            formData.append('file', file);
            // 清空input
            

        }
    </script>
</body>
</html>